﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SevenWizards1.CoreComponents;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;

namespace SevenWizards1
{
    class ActionScreen : GameScreen
    {
        SpriteFont gameFont;
        Texture2D tileset;
        ContentManager Content;
        SpriteBatch spriteBatch;

        string tilesetName;
        TileEngine tileEngine;

        public ActionScreen(Game game, SpriteFont gameFont, string tilesetName)
            : base(game)
        {
            this.gameFont = gameFont;
            Content =
                (ContentManager)Game.Services.GetService(typeof(ContentManager));

            spriteBatch =
                (SpriteBatch)Game.Services.GetService(typeof(SpriteBatch));
            this.tilesetName = tilesetName;
            LoadContent();

            tileEngine = new TileEngine(game, this.tileset, 50, 50);
            Components.Add(tileEngine);
            tileEngine.Show();
        }

        protected override void LoadContent()
        {
            base.LoadContent();
            tileset = Content.Load<Texture2D>(@"Tilesets\" + tilesetName);
        }

        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
        }

        public override void Draw(GameTime gameTime)
        {
            base.Draw(gameTime);
        }

        public override void Show()
        {
            base.Show();
            Enabled = true;
            Visible = true;
        }

        public override void Hide()
        {
            base.Hide();
            Enabled = false;
            Visible = false;
        }
    }
}
